theorem for diophantine equation